# Makefile for iTextUploader
# Revision: $Id$

CC = arm-apple-darwin9-gcc
LD = $(CC)
LDFLAGS = -lobjc \
	-lcrypto \
	-lsqlite3 \
	-framework CoreFoundation \
	-framework Foundation \
	-framework UIKit \
	-framework CoreGraphics \
	-framework CFNetwork \
	-framework AppSupport \
	-framework AddressBook \
	-L"/usr/lib"\
	-F"/System/Library/Frameworks"\
	-F"/System/Library/PrivateFrameworks"\
	-bind_at_load \
	-multiply_defined suppress
CFLAGS = -I/var/include

all:	iTextUploader

iTextUploader: main.m iTextUploaderAppDelegate.m MainView.m HomeView.m PreferencesData.m PreferencesView.m UploadView.m BrowseView.m AlertBox.m ExportedView.m TextAlertView.m ITUImport.m ASIFormDataRequest.m ASIHTTPRequest.m ASINetworkQueue.m NSHTTPCookieAdditions.m SBJSON.m
	$(LD) $(LDFLAGS) -o $@ $^
	ldid -S iTextUploader
	-mkdir iTextUploader.app/
	cp -p iTextUploader ./iTextUploader.app/
	cp -p Info.plist ./iTextUploader.app/
	cp -p icon.png ./iTextUploader.app/
	cp -p Preferences.png ./iTextUploader.app/
	cp -p Home.png ./iTextUploader.app/
	cp -p Upload.png ./iTextUploader.app/
	cp -p Browse.png ./iTextUploader.app/
	cp -p Exported.png ./iTextUploader.app/
	cp -p Paypal.gif ./iTextUploader.app/
	cp -p loading_bg.png ./iTextUploader.app/
	cp -p ConnectionError.html ./iTextUploader.app/
	cp -p UploadViewMainText.html ./iTextUploader.app/
	cp -p AboutText.html ./iTextUploader.app/
	cp -p ExportedViewNoFilesText.html ./iTextUploader.app/
	cp -p ExportedViewWithFilesText.html ./iTextUploader.app/

install:
	-rm -rv /Applications/iTextUploader.app
	cp -rv iTextUploader.app/ /Applications/

clean:
	rm -vf *.o *.gch iTextUploader
	rm -rv iTextUploader.app

%.o:       %.m
	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@

%.o:       %.c
	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@

%.o:       %.cpp
	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
